In [1]:
import matplotlib.pyplot as plt
import os
import numpy as np
import pprint
from wind_tunnel import AeroCoefficients, TunnelRecord
import sympy_utils
%load_ext autoreload
%autoreload 2
%matplotlib inline
plt.rcParams['lines.markersize']= 10
plt.rcParams['font.size']= 12
In [2]:
const = {'S': 0.35, 'c_bar': 0.3, 'x_ac': 0.1, 'rho': 1.225, 'span': 0.91}
In [3]:
tr_mounts = TunnelRecord.load(
os.path.join('flapping-wing',
'camflyer062814mountscont_.txt'), skip=[0])
ac_mounts = AeroCoefficients.from_TunnelRecord(tr_mounts, const['S'], const['c_bar'])
In [4]:
tr = TunnelRecord.load(
os.path.join('flapping-wing',
'FlappingWing1.txt'), skip=[0])
ac = AeroCoefficients.from_TunnelRecord(tr, const['S'], const['c_bar'])
ac = ac.subtract(ac_mounts)
ac.plot()
tr_glide = tr
glide = {'fit': ac.fit(), 'tr': tr, 'ac': ac}
glide['fit']
Out[4]:
In [5]:
glide_fit = sympy_utils.load_repr(os.path.join('save', 's1_glide_fit.repr'));
glide_fit
Out[5]:
In [6]:
tr = TunnelRecord.load(
os.path.join('flapping-wing',
'FlappingWing_roll_left.txt'))
ac = AeroCoefficients.from_TunnelRecord(tr, const['S'], const['c_bar'])
ac = ac.subtract(ac_mounts)
ac.plot();
roll_left = {'fit': ac.fit(), 'tr': tr, 'ac': ac}
roll_left['fit']
Out[6]:
In [7]:
tr = TunnelRecord.load(
os.path.join('flapping-wing',
'FlappingWing_roll_right.txt'))
ac = AeroCoefficients.from_TunnelRecord(tr, const['S'], const['c_bar'])
ac = ac.subtract(ac_mounts)
ac.plot();
roll_right = {'fit': ac.fit(), 'tr': tr, 'ac': ac}
roll_right['fit']
Out[7]:
In [8]:
tr = TunnelRecord.load(
os.path.join('flapping-wing',
'FlappingWing_wings_up.txt'))
ac = AeroCoefficients.from_TunnelRecord(tr, const['S'], const['c_bar'])
ac = ac.subtract(ac_mounts)
ac.plot();
wings_up = {'fit': ac.fit(), 'tr': tr, 'ac': ac}
wings_up['fit']
Out[8]:
In [9]:
tr = TunnelRecord.load(
os.path.join('flapping-wing',
'FlappingWing_wings_down.txt'))
ac = AeroCoefficients.from_TunnelRecord(tr, const['S'], const['c_bar'])
ac = ac.subtract(ac_mounts)
ac.plot();
wings_down = {'fit': ac.fit(), 'tr': tr, 'ac': ac}
wings_down['fit']
Out[9]:
In [11]:
fits = {
'glide': glide['fit'],
'roll_left': roll_left['fit'],
'roll_right': roll_right['fit'],
'wings_up': wings_up['fit'],
'wings_down': wings_down['fit']}
sympy_utils.save_repr(fits, os.path.join('save', 's1_aero_fit.repr'))